<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('工厂出入库列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>生产实体：</label>
                            <input type="text" name="carNumber"/>
                        </li>
                        <li>
                            <label>公司：</label>
                            <input type="text" name="departmentId"/>
                        </li>

                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm"
                               onclick="$.table.search('formId','bootstrap-table')"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm"
                               onclick="$.form.reset('formId','bootstrap-table')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">

            <a class="btn btn-warning" onclick="$.table.exportExcel()"
                >
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-bordered">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('viewFactoryInOrOutJob:viewFactoryInOrOutJob:edit')}]];
    var removeFlag = [[${@permission.hasPermi('viewFactoryInOrOutJob:viewFactoryInOrOutJob:remove')}]];
    var company = [[${@dict.getType('company')}]];
    var factory = [[${@dict.getType('factory')}]];
    var prefix = ctx + "search/viewFactoryInOrOutJob";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "工厂出入库",
            pagination: false,//不显示分页
            clickToSelect: true,//是否启用点击选中行
            uniqueId: "carNumber",//表主键(用于修改和删除)
            sortName: "carNumber",//必加排序 sortOrder: "asc"默认
            columns: [
                {
                    halign: 'center',
                    align: 'center',
                    checkbox: true
                },
                {
                    title: "序号",
                    halign: 'center',
                    align: 'center',
                    width: 55,
                    formatter: function (value, row, index) {
                        //获取每页显示的数量
                        var pageSize = $('#bootstrap-table').bootstrapTable('getOptions').pageSize;
                        //获取当前是第几页
                        var pageNumber = $('#bootstrap-table').bootstrapTable('getOptions').pageNumber;
                        //返回序号，注意index是从0开始的，所以要加上1
                        return pageSize * (pageNumber - 1) + index + 1;

                    }
                },

                {
                    field: 'carNumber',
                    title: '生产实体',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true,
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(factory, value);
                    }
                },
                {
                    field: 'departmentId',
                    title: '公司',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true,
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(company, value);
                    }
                },
                {
                    field: 'januaryInSales',
                    title: '1月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'januaryOutSales',
                    title: '1月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'februaryInSales',
                    title: '2月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'februaryOutSales',
                    title: '2月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },

                {
                    field: 'marchInSales',
                    title: '3月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'marchOutSales',
                    title: '3月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'aprilInSales',
                    title: '4月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'aprilOutSales',
                    title: '4月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'mayInSales',
                    title: '5月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'mayOutSales',
                    title: '5月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },

                {
                    field: 'juneInSales',
                    title: '6月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'juneOutSales',
                    title: '6月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },

                {
                    field: 'julyInSales',
                    title: '7月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'julyOutSales',
                    title: '7月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },

                {
                    field: 'augustInSales',
                    title: '8月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'augustOutSales',
                    title: '8月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'septemberInSales',
                    title: '9月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'septemberOutSales',
                    title: '9月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'octoberInSales',
                    title: '10月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'octoberOutSales',
                    title: '10月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'novemberInSales',
                    title: '11月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'novemberOutSales',
                    title: '11月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },
                {
                    field: 'decemberInSales',
                    title: '12月采购入库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },

                {
                    field: 'decemberOutSales',
                    title: '12月生产出库',
                    halign: 'center',
                    align: 'center',
                    sortable: true,
                    visible: true
                },


            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>